﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SC.GirdManage.Common;
using SC.GridManage.MN.API.Read.Application.Command;

namespace SC.GridManage.MN.API.Read.Controllers
{
    /// <summary>
    /// 文章控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ArticalController : ControllerBase
    {
        private readonly IMediator mediator;

        public ArticalController(IMediator mediator) {
            this.mediator = mediator;
        }
        /// <summary>
        /// 查询分页的文章列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<ApiResult<ApiPaging<QueryArticalDTO>>> GetArticalPage([FromQuery]QueryArticalCommand request) { 
        
            return mediator.Send(request);
        }

    }
}
